package hypeerweb;

import java.io.ObjectStreamException;

import proxyCommand.*;
import visitor.*;

public class NodeProxy extends Node {
    private GlobalObjectId globalObjectId;

    public NodeProxy(GlobalObjectId globalObjectId) {
        this.globalObjectId = globalObjectId;
        this.localObjectId = globalObjectId.getLocalObjectId();
    }

    public java.lang.String toString() {
        String[] parameterTypeNames = new String[0];
        Object[] actualParameters = new Object[0];
        Command command = new Command(globalObjectId.getLocalObjectId(), "hypeerweb.Node", "toString", parameterTypeNames, actualParameters, true);
        Object result = PeerCommunicator.getSingleton().sendSynchronous(globalObjectId, command);
        return (java.lang.String)result;
    }

    public Node accept(Visitor p0, Parameters p1) {
        String[] parameterTypeNames = new String[2];
        parameterTypeNames[0] = "visitor.Visitor";
        parameterTypeNames[1] = "visitor.Parameters";
        Object[] actualParameters = new Object[2];
        actualParameters[0] = p0;
        actualParameters[1] = p1;
        Command command = new Command(globalObjectId.getLocalObjectId(), "hypeerweb.Node", "accept", parameterTypeNames, actualParameters, true);
        Object result = PeerCommunicator.getSingleton().sendSynchronous(globalObjectId, command);
        return (Node)result;
    }

    public boolean setConnections(hypeerweb.Connections p0) {
        String[] parameterTypeNames = new String[1];
        parameterTypeNames[0] = "hypeerweb.Connections";
        Object[] actualParameters = new Object[1];
        actualParameters[0] = p0;
        Command command = new Command(globalObjectId.getLocalObjectId(), "hypeerweb.Node", "setConnections", parameterTypeNames, actualParameters, true);
        return (Boolean)PeerCommunicator.getSingleton().sendSynchronous(globalObjectId, command);
    }

    public hypeerweb.Connections getConnections() {
        String[] parameterTypeNames = new String[0];
        Object[] actualParameters = new Object[0];
        Command command = new Command(globalObjectId.getLocalObjectId(), "hypeerweb.Node", "getConnections", parameterTypeNames, actualParameters, true);
        Object result = PeerCommunicator.getSingleton().sendSynchronous(globalObjectId, command);
        return (hypeerweb.Connections)result;
    }

    public hypeerweb.Connections getChildConnections(hypeerweb.Node p0) {
        String[] parameterTypeNames = new String[1];
        parameterTypeNames[0] = "hypeerweb.Node";
        Object[] actualParameters = new Object[1];
        actualParameters[0] = p0;
        Command command = new Command(globalObjectId.getLocalObjectId(), "hypeerweb.Node", "getChildConnections", parameterTypeNames, actualParameters, true);
        Object result = PeerCommunicator.getSingleton().sendSynchronous(globalObjectId, command);
        return (hypeerweb.Connections)result;
    }

    public hypeerweb.SimplifiedNodeDomain constructSimplifiedNodeDomain() {
        String[] parameterTypeNames = new String[0];
        Object[] actualParameters = new Object[0];
        Command command = new Command(globalObjectId.getLocalObjectId(), "hypeerweb.Node", "constructSimplifiedNodeDomain", parameterTypeNames, actualParameters, true);
        Object result = PeerCommunicator.getSingleton().sendSynchronous(globalObjectId, command);
        return (hypeerweb.SimplifiedNodeDomain)result;
    }

    public hypeerweb.Node getFold() {
        String[] parameterTypeNames = new String[0];
        Object[] actualParameters = new Object[0];
        Command command = new Command(globalObjectId.getLocalObjectId(), "hypeerweb.Node", "getFold", parameterTypeNames, actualParameters, true);
        Object result = PeerCommunicator.getSingleton().sendSynchronous(globalObjectId, command);
        return (hypeerweb.Node)result;
    }

    public int getHeight() {
        String[] parameterTypeNames = new String[0];
        Object[] actualParameters = new Object[0];
        Command command = new Command(globalObjectId.getLocalObjectId(), "hypeerweb.Node", "getHeight", parameterTypeNames, actualParameters, true);
        Object result = PeerCommunicator.getSingleton().sendSynchronous(globalObjectId, command);
        return (Integer)result;
    }

    public java.util.HashSet getWebIds(java.util.HashSet p0) {
        String[] parameterTypeNames = new String[1];
        parameterTypeNames[0] = "java.util.HashSet";
        Object[] actualParameters = new Object[1];
        actualParameters[0] = p0;
        Command command = new Command(globalObjectId.getLocalObjectId(), "hypeerweb.Node", "getWebIds", parameterTypeNames, actualParameters, true);
        Object result = PeerCommunicator.getSingleton().sendSynchronous(globalObjectId, command);
        return (java.util.HashSet)result;
    }

    public hypeerweb.WebId getWebId() {
    	return webId;
        /*String[] parameterTypeNames = new String[0];
        Object[] actualParameters = new Object[0];
        Command command = new Command(globalObjectId.getLocalObjectId(), "hypeerweb.Node", "getWebId", parameterTypeNames, actualParameters, true);
        Object result = PeerCommunicator.getSingleton().sendSynchronous(globalObjectId, command);
        return (hypeerweb.WebId)result;*/
    }

    public boolean setWebId(hypeerweb.WebId p0) {
        String[] parameterTypeNames = new String[1];
        parameterTypeNames[0] = "hypeerweb.WebId";
        Object[] actualParameters = new Object[1];
        actualParameters[0] = p0;
        Command command = new Command(globalObjectId.getLocalObjectId(), "hypeerweb.Node", "setWebId", parameterTypeNames, actualParameters, true);
        return (Boolean)PeerCommunicator.getSingleton().sendSynchronous(globalObjectId, command);
    }

    public boolean setMyNode(hypeerweb.Node p0) {
        String[] parameterTypeNames = new String[1];
        parameterTypeNames[0] = "hypeerweb.Node";
        Object[] actualParameters = new Object[1];
        actualParameters[0] = p0;
        Command command = new Command(globalObjectId.getLocalObjectId(), "hypeerweb.Node", "setMyNode", parameterTypeNames, actualParameters, true);
        return (Boolean)PeerCommunicator.getSingleton().sendSynchronous(globalObjectId, command);
    }

    public boolean setFold(hypeerweb.Node p0) {
        String[] parameterTypeNames = new String[1];
        parameterTypeNames[0] = "hypeerweb.Node";
        Object[] actualParameters = new Object[1];
        actualParameters[0] = p0;
        Command command = new Command(globalObjectId.getLocalObjectId(), "hypeerweb.Node", "setFold", parameterTypeNames, actualParameters, true);
        return (Boolean)PeerCommunicator.getSingleton().sendSynchronous(globalObjectId, command);
    }

    public boolean setNewFold(hypeerweb.Node p0) {
        String[] parameterTypeNames = new String[1];
        parameterTypeNames[0] = "hypeerweb.Node";
        Object[] actualParameters = new Object[1];
        actualParameters[0] = p0;
        Command command = new Command(globalObjectId.getLocalObjectId(), "hypeerweb.Node", "setNewFold", parameterTypeNames, actualParameters, true);
        return (Boolean) PeerCommunicator.getSingleton().sendSynchronous(globalObjectId, command);
    }

    public boolean removeFold(hypeerweb.Node p0) {
        String[] parameterTypeNames = new String[1];
        parameterTypeNames[0] = "hypeerweb.Node";
        Object[] actualParameters = new Object[1];
        actualParameters[0] = p0;
        Command command = new Command(globalObjectId.getLocalObjectId(), "hypeerweb.Node", "removeFold", parameterTypeNames, actualParameters, true);
        return (Boolean)PeerCommunicator.getSingleton().sendSynchronous(globalObjectId, command);
    }

    public boolean replaceFold(hypeerweb.Node p0) {
        String[] parameterTypeNames = new String[1];
        parameterTypeNames[0] = "hypeerweb.Node";
        Object[] actualParameters = new Object[1];
        actualParameters[0] = p0;
        Command command = new Command(globalObjectId.getLocalObjectId(), "hypeerweb.Node", "replaceFold", parameterTypeNames, actualParameters, true);
        return (Boolean)PeerCommunicator.getSingleton().sendSynchronous(globalObjectId, command);
    }

    public boolean setSurrogateFold(hypeerweb.Node p0) {
        String[] parameterTypeNames = new String[1];
        parameterTypeNames[0] = "hypeerweb.Node";
        Object[] actualParameters = new Object[1];
        actualParameters[0] = p0;
        Command command = new Command(globalObjectId.getLocalObjectId(), "hypeerweb.Node", "setSurrogateFold", parameterTypeNames, actualParameters, true);
        return (Boolean)PeerCommunicator.getSingleton().sendSynchronous(globalObjectId, command);
    }
    
    public boolean setNewSurrogateFold(hypeerweb.Node p0) {
        String[] parameterTypeNames = new String[1];
        parameterTypeNames[0] = "hypeerweb.Node";
        Object[] actualParameters = new Object[1];
        actualParameters[0] = p0;
        Command command = new Command(globalObjectId.getLocalObjectId(), "hypeerweb.Node", "setNewSurrogateFold", parameterTypeNames, actualParameters, true);
        return (Boolean)PeerCommunicator.getSingleton().sendSynchronous(globalObjectId, command);
    }

    public boolean setInverseSurrogateFold(hypeerweb.Node p0) {
        String[] parameterTypeNames = new String[1];
        parameterTypeNames[0] = "hypeerweb.Node";
        Object[] actualParameters = new Object[1];
        actualParameters[0] = p0;
        Command command = new Command(globalObjectId.getLocalObjectId(), "hypeerweb.Node", "setInverseSurrogateFold", parameterTypeNames, actualParameters, true);
        return (Boolean)PeerCommunicator.getSingleton().sendSynchronous(globalObjectId, command);
    }

    public boolean removeInverseSurrogateFold(hypeerweb.Node p0) {
        String[] parameterTypeNames = new String[1];
        parameterTypeNames[0] = "hypeerweb.Node";
        Object[] actualParameters = new Object[1];
        actualParameters[0] = p0;
        Command command = new Command(globalObjectId.getLocalObjectId(), "hypeerweb.Node", "removeInverseSurrogateFold", parameterTypeNames, actualParameters, true);
        return (Boolean)PeerCommunicator.getSingleton().sendSynchronous(globalObjectId, command);
    }

    public boolean addNeighbor(hypeerweb.Node p0) {
        String[] parameterTypeNames = new String[1];
        parameterTypeNames[0] = "hypeerweb.Node";
        Object[] actualParameters = new Object[1];
        actualParameters[0] = p0;
        Command command = new Command(globalObjectId.getLocalObjectId(), "hypeerweb.Node", "addNeighbor", parameterTypeNames, actualParameters, true);
        return (Boolean)PeerCommunicator.getSingleton().sendSynchronous(globalObjectId, command);
    }

    public boolean addNeighbor(hypeerweb.NodeDelegate p0) {
        String[] parameterTypeNames = new String[1];
        parameterTypeNames[0] = "hypeerweb.NodeDelegate";
        Object[] actualParameters = new Object[1];
        actualParameters[0] = p0;
        Command command = new Command(globalObjectId.getLocalObjectId(), "hypeerweb.Node", "addNeighbor", parameterTypeNames, actualParameters, true);
        return (Boolean)PeerCommunicator.getSingleton().sendSynchronous(globalObjectId, command);
    }

    public boolean removeNeighbor(hypeerweb.Node p0) {
        String[] parameterTypeNames = new String[1];
        parameterTypeNames[0] = "hypeerweb.Node";
        Object[] actualParameters = new Object[1];
        actualParameters[0] = p0;
        Command command = new Command(globalObjectId.getLocalObjectId(), "hypeerweb.Node", "removeNeighbor", parameterTypeNames, actualParameters, true);
        return (Boolean)PeerCommunicator.getSingleton().sendSynchronous(globalObjectId, command);
    }

    public boolean removeNeighbor(hypeerweb.NodeDelegate p0) {
        String[] parameterTypeNames = new String[1];
        parameterTypeNames[0] = "hypeerweb.NodeDelegate";
        Object[] actualParameters = new Object[1];
        actualParameters[0] = p0;
        Command command = new Command(globalObjectId.getLocalObjectId(), "hypeerweb.Node", "removeNeighbor", parameterTypeNames, actualParameters, true);
        return (Boolean)PeerCommunicator.getSingleton().sendSynchronous(globalObjectId, command);
    }

    public boolean replaceNeighbor(hypeerweb.NodeDelegate p0, hypeerweb.NodeDelegate p1) {
        String[] parameterTypeNames = new String[2];
        parameterTypeNames[0] = "hypeerweb.NodeDelegate";
        parameterTypeNames[1] = "hypeerweb.NodeDelegate";
        Object[] actualParameters = new Object[2];
        actualParameters[0] = p0;
        actualParameters[1] = p1;
        Command command = new Command(globalObjectId.getLocalObjectId(), "hypeerweb.Node", "replaceNeighbor", parameterTypeNames, actualParameters, true);
        return (Boolean)PeerCommunicator.getSingleton().sendSynchronous(globalObjectId, command);
    }

    public boolean addUpPointer(hypeerweb.Node p0) {
        String[] parameterTypeNames = new String[1];
        parameterTypeNames[0] = "hypeerweb.Node";
        Object[] actualParameters = new Object[1];
        actualParameters[0] = p0;
        Command command = new Command(globalObjectId.getLocalObjectId(), "hypeerweb.Node", "addUpPointer", parameterTypeNames, actualParameters, true);
        return (Boolean)PeerCommunicator.getSingleton().sendSynchronous(globalObjectId, command);
    }

    public boolean addUpPointer(hypeerweb.NodeDelegate p0) {
        String[] parameterTypeNames = new String[1];
        parameterTypeNames[0] = "hypeerweb.NodeDelegate";
        Object[] actualParameters = new Object[1];
        actualParameters[0] = p0;
        Command command = new Command(globalObjectId.getLocalObjectId(), "hypeerweb.Node", "addUpPointer", parameterTypeNames, actualParameters, true);
        return (Boolean)PeerCommunicator.getSingleton().sendSynchronous(globalObjectId, command);
    }

    public boolean removeUpPointer(hypeerweb.Node p0) {
        String[] parameterTypeNames = new String[1];
        parameterTypeNames[0] = "hypeerweb.Node";
        Object[] actualParameters = new Object[1];
        actualParameters[0] = p0;
        Command command = new Command(globalObjectId.getLocalObjectId(), "hypeerweb.Node", "removeUpPointer", parameterTypeNames, actualParameters, true);
        return (Boolean)PeerCommunicator.getSingleton().sendSynchronous(globalObjectId, command);
    }

    public boolean removeUpPointer(hypeerweb.NodeDelegate p0) {
        String[] parameterTypeNames = new String[1];
        parameterTypeNames[0] = "hypeerweb.NodeDelegate";
        Object[] actualParameters = new Object[1];
        actualParameters[0] = p0;
        Command command = new Command(globalObjectId.getLocalObjectId(), "hypeerweb.Node", "removeUpPointer", parameterTypeNames, actualParameters, true);
        return (Boolean)PeerCommunicator.getSingleton().sendSynchronous(globalObjectId, command);
    }
    
    public boolean removeUpPointers() {
        String[] parameterTypeNames = new String[0];
        Object[] actualParameters = new Object[0];
        Command command = new Command(globalObjectId.getLocalObjectId(), "hypeerweb.Node", "removeUpPointers", parameterTypeNames, actualParameters, true);
        return (Boolean)PeerCommunicator.getSingleton().sendSynchronous(globalObjectId, command);
    }

    public boolean replaceUpPointer(hypeerweb.NodeDelegate p0, hypeerweb.NodeDelegate p1) {
        String[] parameterTypeNames = new String[2];
        parameterTypeNames[0] = "hypeerweb.NodeDelegate";
        parameterTypeNames[1] = "hypeerweb.NodeDelegate";
        Object[] actualParameters = new Object[2];
        actualParameters[0] = p0;
        actualParameters[1] = p1;
        Command command = new Command(globalObjectId.getLocalObjectId(), "hypeerweb.Node", "replaceUpPointer", parameterTypeNames, actualParameters, true);
        return (Boolean)PeerCommunicator.getSingleton().sendSynchronous(globalObjectId, command);
    }

    public boolean removeSmallerNeighborsChild() {
        String[] parameterTypeNames = new String[0];
        Object[] actualParameters = new Object[0];
        Command command = new Command(globalObjectId.getLocalObjectId(), "hypeerweb.Node", "removeSmallerNeighborsChild", parameterTypeNames, actualParameters, true);
        return (Boolean)PeerCommunicator.getSingleton().sendSynchronous(globalObjectId, command);
    }

    public boolean addDownPointer(hypeerweb.Node p0) {
        String[] parameterTypeNames = new String[1];
        parameterTypeNames[0] = "hypeerweb.Node";
        Object[] actualParameters = new Object[1];
        actualParameters[0] = p0;
        Command command = new Command(globalObjectId.getLocalObjectId(), "hypeerweb.Node", "addDownPointer", parameterTypeNames, actualParameters, true);
        return (Boolean)PeerCommunicator.getSingleton().sendSynchronous(globalObjectId, command);
    }

    public boolean addDownPointer(hypeerweb.NodeDelegate p0) {
        String[] parameterTypeNames = new String[1];
        parameterTypeNames[0] = "hypeerweb.NodeDelegate";
        Object[] actualParameters = new Object[1];
        actualParameters[0] = p0;
        Command command = new Command(globalObjectId.getLocalObjectId(), "hypeerweb.Node", "addDownPointer", parameterTypeNames, actualParameters, true);
        return (Boolean)PeerCommunicator.getSingleton().sendSynchronous(globalObjectId, command);
    }

    public boolean removeDownPointer(hypeerweb.Node p0) {
        String[] parameterTypeNames = new String[1];
        parameterTypeNames[0] = "hypeerweb.Node";
        Object[] actualParameters = new Object[1];
        actualParameters[0] = p0;
        Command command = new Command(globalObjectId.getLocalObjectId(), "hypeerweb.Node", "removeDownPointer", parameterTypeNames, actualParameters, true);
        return (Boolean)PeerCommunicator.getSingleton().sendSynchronous(globalObjectId, command);
    }

    public boolean removeDownPointer(hypeerweb.NodeDelegate p0) {
        String[] parameterTypeNames = new String[1];
        parameterTypeNames[0] = "hypeerweb.NodeDelegate";
        Object[] actualParameters = new Object[1];
        actualParameters[0] = p0;
        Command command = new Command(globalObjectId.getLocalObjectId(), "hypeerweb.Node", "removeDownPointer", parameterTypeNames, actualParameters, true);
        return (Boolean)PeerCommunicator.getSingleton().sendSynchronous(globalObjectId, command);
    }

    public boolean replaceDownPointer(hypeerweb.NodeDelegate p0, hypeerweb.NodeDelegate p1) {
        String[] parameterTypeNames = new String[2];
        parameterTypeNames[0] = "hypeerweb.NodeDelegate";
        parameterTypeNames[1] = "hypeerweb.NodeDelegate";
        Object[] actualParameters = new Object[2];
        actualParameters[0] = p0;
        actualParameters[1] = p1;
        Command command = new Command(globalObjectId.getLocalObjectId(), "hypeerweb.Node", "replaceDownPointer", parameterTypeNames, actualParameters, true);
        return (Boolean)PeerCommunicator.getSingleton().sendSynchronous(globalObjectId, command);
    }
    
    public hypeerweb.Node getParent() {
        String[] parameterTypeNames = new String[0];
        Object[] actualParameters = new Object[0];
        Command command = new Command(globalObjectId.getLocalObjectId(), "hypeerweb.Node", "getParent", parameterTypeNames, actualParameters, true);
        Object result = PeerCommunicator.getSingleton().sendSynchronous(globalObjectId, command);
        return (hypeerweb.Node)result;
    }
    
    public hypeerweb.Node getSmallestNeighborWithoutChildren() {
        String[] parameterTypeNames = new String[0];
        Object[] actualParameters = new Object[0];
        Command command = new Command(globalObjectId.getLocalObjectId(), "hypeerweb.Node", "getSmallestNeighborWithoutChildren", parameterTypeNames, actualParameters, true);
        Object result = PeerCommunicator.getSingleton().sendSynchronous(globalObjectId, command);
        return (hypeerweb.Node)result;
    }

    public boolean addToHyPeerWeb(hypeerweb.Node p0) {
        String[] parameterTypeNames = new String[1];
        parameterTypeNames[0] = "hypeerweb.Node";
        Object[] actualParameters = new Object[1];
        actualParameters[0] = p0;
        Command command = new Command(globalObjectId.getLocalObjectId(), "hypeerweb.Node", "addToHyPeerWeb", parameterTypeNames, actualParameters, true);
        return (Boolean)PeerCommunicator.getSingleton().sendSynchronous(globalObjectId, command);
    }

    public boolean removeFromHyPeerWeb(hypeerweb.Node p0) {
        String[] parameterTypeNames = new String[1];
        parameterTypeNames[0] = "hypeerweb.Node";
        Object[] actualParameters = new Object[1];
        actualParameters[0] = p0;
        Command command = new Command(globalObjectId.getLocalObjectId(), "hypeerweb.Node", "removeFromHyPeerWeb", parameterTypeNames, actualParameters, true);
        return (Boolean)PeerCommunicator.getSingleton().sendSynchronous(globalObjectId, command);
    }
    
    public boolean shiftNeighborsRight() {
        String[] parameterTypeNames = new String[0];
        Object[] actualParameters = new Object[0];
        Command command = new Command(globalObjectId.getLocalObjectId(), "hypeerweb.Node", "shiftNeighborsRight", parameterTypeNames, actualParameters, true);
        return (Boolean)PeerCommunicator.getSingleton().sendSynchronous(globalObjectId, command);
    }

    public boolean shiftNeighborsLeft() {
        String[] parameterTypeNames = new String[0];
        Object[] actualParameters = new Object[0];
        Command command = new Command(globalObjectId.getLocalObjectId(), "hypeerweb.Node", "shiftNeighborsLeft", parameterTypeNames, actualParameters, true);
        return (Boolean)PeerCommunicator.getSingleton().sendSynchronous(globalObjectId, command);
    }
    
    public hypeerweb.Node find(hypeerweb.Node p0, hypeerweb.WebId p1) {
        String[] parameterTypeNames = new String[2];
        parameterTypeNames[0] = "hypeerweb.Node";
        parameterTypeNames[1] = "hypeerweb.WebId";
        Object[] actualParameters = new Object[2];
        actualParameters[0] = p0;
        actualParameters[1] = p1;
        Command command = new Command(globalObjectId.getLocalObjectId(), "hypeerweb.Node", "find", parameterTypeNames, actualParameters, true);
        Object result = PeerCommunicator.getSingleton().sendSynchronous(globalObjectId, command);
        return (hypeerweb.Node)result;
    }
    
    public boolean replaceNodeProxyWithNode(hypeerweb.Node p0){
        String[] parameterTypeNames = new String[1];
        parameterTypeNames[0] = "hypeerweb.Node";
        Object[] actualParameters = new Object[1];
        actualParameters[0] = p0;
        Command command = new Command(globalObjectId.getLocalObjectId(), "hypeerweb.Node", "replaceNodeProxyWithNode", parameterTypeNames, actualParameters, true);
        return (Boolean)PeerCommunicator.getSingleton().sendSynchronous(globalObjectId, command);
    }

    public visitor.Contents getContents() {
        String[] parameterTypeNames = new String[0];
        Object[] actualParameters = new Object[0];
        Command command = new Command(globalObjectId.getLocalObjectId(), "hypeerweb.Node", "getContents", parameterTypeNames, actualParameters, true);
        Object result = PeerCommunicator.getSingleton().sendSynchronous(globalObjectId, command);
        return (visitor.Contents)result;
    }

    public java.util.ArrayList getNeighborsToBroadcast() {
        String[] parameterTypeNames = new String[0];
        Object[] actualParameters = new Object[0];
        Command command = new Command(globalObjectId.getLocalObjectId(), "hypeerweb.Node", "getNeighborsToBroadcast", parameterTypeNames, actualParameters, true);
        Object result = PeerCommunicator.getSingleton().sendSynchronous(globalObjectId, command);
        return (java.util.ArrayList)result;
    }

    public boolean equals(java.lang.Object p0) {
        String[] parameterTypeNames = new String[1];
        parameterTypeNames[0] = "java.lang.Object";
        Object[] actualParameters = new Object[1];
        actualParameters[0] = p0;
        Command command = new Command(globalObjectId.getLocalObjectId(), "java.lang.Object", "equals", parameterTypeNames, actualParameters, true);
        Object result = PeerCommunicator.getSingleton().sendSynchronous(globalObjectId, command);
        return (Boolean)result;
    }


    public Object writeReplace() throws ObjectStreamException {
    	return this; 
    }
    
    public Object readResolve() throws ObjectStreamException {
    	//System.out.println("Calling Read Resolve");
    	//see if a real node exists
    	GlobalObjectId global = HyPeerWeb.getSingleton().getGlobalObjectId();
    	//System.out.println(" machine addr"+this.globalObjectId.getMachineAddr()+"vs"+global.getMachineAddr());
    	if(this.globalObjectId.getMachineAddr().equalsIgnoreCase(global.getMachineAddr()) && this.globalObjectId.getPortNumber().equals(global.getPortNumber())) {
        	//System.out.println("The proxy is on this machine attempting to return: "+this.globalObjectId.getLocalObjectId()+" from database");

    		//we are here so we can get it out of the database and return that instead of a proxy
    		return ObjectDB.getSingleton().getValue(this.globalObjectId.getLocalObjectId());
    	}
    	else {
    		//System.out.println("Returning this");
    		return this;
    	}
    }

	public GlobalObjectId getGlobalObjectId() {
		return globalObjectId;
	}
	
	public void changeWebId(WebId w) {
		this.webId = w;
	}
	
	/*public WebId getProxyWebId() {
		return this.webId;
	}*/
}